 function skuTable() {
  if (
    this.skucolor.selectArr.length > 0 &&
    this.skusize.selectArr.length == 0
  ) {
    var newArr = []
    this.skucolor.selectArr.forEach((item) => {
      if (typeof item === 'object') {
        newArr.push([...item])
      } else {
        newArr.push([item])
      }
    })
  } else {
    var newArr = arr.reduce((total, current) => {
      var skuArr = []
      total.forEach((out) => {
        current.forEach((inner) => {
          // 判断out是否是数组类型
          if (typeof out === 'object') {
            // 解构out数组
            skuArr.push([...out, inner])
          } else {
            skuArr.push([out, inner])
          }
        })
      })
      return skuArr
    })
  }
  // 处理newArr变成table表单
  console.log('newArr==', newArr)
  newArr.forEach((item) => {
    const arr = [
      { key: '颜色', value: item[0] },
      { key: '大小', value: item[1] }
    ]
    this.skuList.push({
      spData: arr,
      tempId: uuid(), // 生成唯一标识符
      ...obj
    })
  })
}
export default skuTable
